package com.xnyzc.lhy.mis.controller.cmsapi.manager;

import com.xnyzc.lhy.common.entity.Rv;
import com.xnyzc.lhy.mis.entity.manager.OaSysManager;
import com.xnyzc.lhy.mis.entity.system.OaSysSendMessage;
import com.xnyzc.lhy.mis.service.manager.OaSysManagerService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 司管控制器
 */
@RestController
@RequestMapping("/cmsapi/manager")
public class OaSysManagerController {

    @Autowired
    private OaSysManagerService oaSysManagerService;

    /**
     * 获取司管信息
     * @param cityId 城市id
     * @param isTopManagement 最高权限者为true，反之为false
     * @return
     */
    @ApiOperation(value = "获取司管信息", notes = "获取司管信息")
    @GetMapping (value = "/getManagerInfo")
    public Rv getUserInfo(@RequestParam("cityId") Long cityId,
                          @RequestParam("isTopManagement")Boolean isTopManagement) {
        return Rv.wrap(oaSysManagerService.getManagerInfo(cityId,isTopManagement));
    }

    /**
     * 新增或者修改司管信息 弃用，改用setManagerInfo
     * @return
     */
    @ApiOperation(value = "新增或者修改司管信息", notes = "新增或者修改司管信息")
    @PostMapping (value = "/getAddOrUpdateManagerInfo")
    public Rv getAddOrUpdateManagerInfo(@ApiParam(name = "oaSysManager", value = "司管信息表") @RequestBody OaSysManager oaSysManager) {
        return Rv.wrap(oaSysManagerService.getAddOrUpdateManagerInfo(oaSysManager));
    }
    /**
     * 新增
     */
    @ApiOperation(value = "新增或者修改司管信息", notes = "新增或者修改司管信息")
    @PostMapping (value = "/setManagerInfo")
    public Rv setManagerInfo(@ApiParam(name = "OaSysSendMessage", value = "短信发送") @RequestBody OaSysSendMessage oaSysSendMessage){
        return oaSysManagerService.setManagerInfo(oaSysSendMessage);
    }
    /**
     * 预约单到时间未派单执行司管提醒
     * @return
     */
   /* @ApiOperation(value = "预约单到时间未派单执行司管提醒", notes = "预约单到时间未派单执行司管提醒")
    @PostMapping (value = "/task/managerOrderMSG")
    public Rv managerOrderMSG() {
        return Rv.wrap(oaSysManagerService.managerOrderMSG());
    }*/
}
